// Benke PDF. C6 p09.
// Guess a number.
#include <stdio.h>
int main()
{
    int x, y;

    x = y = 0;

    for (x = 0; y != 123 && x <= 2; x++)
    {
        printf("You have %d times to guess:", 3 - x);
        scanf("%d", &y);
        printf("\n");
    }

    if (y == 123)
        printf("Smart! You are right!\n");
    else
        printf("Sorry!\n");

    return 0;
}